"""
@author: Shizuku
@file: 2022-10-28-practice.py
@time: 2022/10/28 17:29
"""
import random

def exer1():
    seed ="01"
    l= []
    for i in range(11):
        l.append(random.choice(seed))
    lamp = ''.join(l)
    num = random.randint(0,11)
    print(lamp, num)
    if int(lamp[num]) == 0:
        print("灯是灭的")
    else:
        print("灯是亮的")

def exer2():
    num = input("请输入身份证号：")
    if num.isdigit() and len(num) == 18 :
        birth = num[6:10]
        age = 2022 -int(birth)
        if 0 <= age < 18 :
            print("未成年")
        elif 18 <= age <=50 :
            print("青壮年")
        elif age > 50 :
            print("老年")
        else:
            print("你是穿越过来的吧")
    else:
        print("请输入正确的身份证号")


